﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="WPF_FDS.AutoScrollListBoxDictionary">
	<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <!-- Fill Brushes -->

    <SolidColorBrush x:Key="NormalBrush" Color="#FFCCCCCC"/>

    <SolidColorBrush x:Key="PressedBrush" Color="#FFEEEEEE"/>

    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />

    <!-- Border Brushes -->

    <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
  </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>


    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border x:Name="Border" CornerRadius="2"  Background="Transparent"
                              BorderBrush="{StaticResource NormalBorderBrush}" >
                        <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#FF1DC4C0"
                                Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" 
                                Opacity="{Binding Opacity, RelativeSource={RelativeSource TemplatedParent}}"  />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border CornerRadius="2" 
                                BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{x:Null}" >
                    	<Grid>
                    		<Grid.RowDefinitions>
                    			<RowDefinition Height="0.917*"/>
                    			<RowDefinition Height="0.083*"/>
                    		</Grid.RowDefinitions>
                    		<Grid.ColumnDefinitions>
                    			<ColumnDefinition Width="0.951*"/>
                    			<ColumnDefinition Width="0.049*"/>
                    		</Grid.ColumnDefinitions>
                    		<Rectangle Grid.Column="0" Margin="0" RadiusX="2" RadiusY="2" Grid.Row="1" Grid.RowSpan="1" Grid.ColumnSpan="2">
                    			<Rectangle.Fill>
                    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    					<GradientStop Color="#FF33E1E5" Offset="0.514"/>
                    					<GradientStop Color="White" Offset="1"/>
                    					<GradientStop Color="#FFEEF1F1" Offset="0.052"/>
                    				</LinearGradientBrush>
                    			</Rectangle.Fill>
                    		</Rectangle></Grid>
                    	</Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
<Style x:Key="ScrollBarThumbVertical" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border CornerRadius="2" 
                                BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{x:Null}" >
                    	<Grid>
                    		<Grid.RowDefinitions>
                    			<RowDefinition Height="0.917*"/>
                    			<RowDefinition Height="0.083*"/>
                    		</Grid.RowDefinitions>
                    		<Grid.ColumnDefinitions>
                    			<ColumnDefinition Width="0.951*"/>
                    			<ColumnDefinition Width="0.049*"/>
                    		</Grid.ColumnDefinitions>
                    		<Rectangle Grid.Column="1" Margin="0" RadiusX="2" RadiusY="2" Grid.Row="0" Grid.RowSpan="2" Grid.ColumnSpan="1">
                    			<Rectangle.Fill>
                    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    					<GradientStop Color="#FF33E1E5" Offset="0.514"/>
                    					<GradientStop Color="White" Offset="1"/>
                    					<GradientStop Color="#FFEEF1F1" Offset="0.052"/>
                    				</LinearGradientBrush>
                    			</Rectangle.Fill>
                    		</Rectangle></Grid>
                    	</Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CustomListBoxItem" TargetType="{x:Type ListBoxItem}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border  x:Name="Border" Padding="1" SnapsToDevicePixels="true">
                        <ContentPresenter />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--listBoxWithAutoScroll_Horizontal-->
    <Style x:Key="ListBoxWithAutoScroll_Horizontal" TargetType="{x:Type ListBox}" >
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="Background" Value="Transparent"/>
		<Setter Property="ItemTemplate" Value="{DynamicResource MyEquityTemplate}"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource CustomListBoxItem}"/>
        <Setter Property="Template">
        	<Setter.Value>
        		<ControlTemplate TargetType="{x:Type ListBox}">
        			<Grid >
        				<ScrollViewer x:Name="scrollviewer" >
        					<ScrollViewer.Template>
        						<ControlTemplate TargetType="{x:Type ScrollViewer}" >
        							<Grid>
        								<ScrollBar x:Name="PART_HorizontalScrollBar" Orientation="Horizontal" 
        									Value="{TemplateBinding HorizontalOffset}"
        									Maximum="{TemplateBinding ScrollableWidth}"
        									ViewportSize="{TemplateBinding ViewportWidth}"
        									Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
        									Height="{Binding Height, ElementName=Panel}">
        									<ScrollBar.Template>
        										<ControlTemplate>
        											<Track x:Name="PART_Track">
        												<Track.DecreaseRepeatButton>
        													<RepeatButton Command="ScrollBar.PageLeftCommand"
        														Style="{StaticResource ScrollBarPageButton}"/>
        												</Track.DecreaseRepeatButton>
        												<Track.IncreaseRepeatButton>
        													<RepeatButton Command="ScrollBar.PageRightCommand"
        														Style="{StaticResource ScrollBarPageButton}"/>
        												</Track.IncreaseRepeatButton>
        												<Track.Thumb>
        													<Thumb Style="{StaticResource ScrollBarThumb}" 
        														Background="Gray" Opacity="0.8" Margin="0,-1" />
        												</Track.Thumb>
        											</Track>
        										</ControlTemplate>
        									</ScrollBar.Template>
        								</ScrollBar>
        								<ScrollContentPresenter Margin="0,2" Height="Auto" VerticalAlignment="Center"/>
        							</Grid>
        						</ControlTemplate>
        					</ScrollViewer.Template>
        					<ItemsPresenter/>
        				</ScrollViewer>
        				<Grid x:Name="Panel" Margin="0,2" >
        					<Grid.ColumnDefinitions>
        						<ColumnDefinition Width="Auto"/>
        						<ColumnDefinition Width="*"/>
        						<ColumnDefinition Width="Auto"/>
        					</Grid.ColumnDefinitions>
        					<RepeatButton x:Name="LineLeftButton" Grid.Column="0" Width="20" Opacity="0" Visibility="Collapsed"
        						Style="{StaticResource ScrollBarLineButton}"
        						Content="M 8 0 L 8 32 L 0 16 Z"       
        						Command="{x:Static ScrollBar.LineLeftCommand}"       
        						CommandTarget="{Binding ElementName=scrollviewer}"
        						ClickMode="Hover" />
        					<RepeatButton x:Name="LineRightButton" Grid.Column="2" Width="20" Opacity="0" Visibility="Collapsed"
        						Style="{StaticResource ScrollBarLineButton}"
        						Content="M 0 0 L 8 16 L 0 32 Z" 
        						Command="{x:Static ScrollBar.LineRightCommand}"       
        						CommandTarget="{Binding ElementName=scrollviewer}"
        						ClickMode="Hover"/>
        				</Grid>
        			</Grid>
        			<ControlTemplate.Triggers>
        				<MultiTrigger>
        					<MultiTrigger.Conditions>
        						<Condition Property="IsMouseOver" Value="True"/>
        						<Condition Property="ComputedHorizontalScrollBarVisibility" SourceName="scrollviewer" Value="Visible"/>
        					</MultiTrigger.Conditions>
        					<MultiTrigger.EnterActions>
        						<BeginStoryboard>
        							<Storyboard>
        								<DoubleAnimation Storyboard.TargetName="LineLeftButton" 
        									Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
        								<DoubleAnimation Storyboard.TargetName="LineRightButton" 
        									Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
        							</Storyboard>
        						</BeginStoryboard>
        					</MultiTrigger.EnterActions>
        					<MultiTrigger.ExitActions>
        						<BeginStoryboard>
        							<Storyboard>
        								<DoubleAnimation Storyboard.TargetName="LineLeftButton" 
        									Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
        								<DoubleAnimation Storyboard.TargetName="LineRightButton" 
        									Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
        							</Storyboard>
        						</BeginStoryboard>
        					</MultiTrigger.ExitActions>
        					<Setter TargetName="LineLeftButton" Property="Visibility" Value="Visible" />
        					<Setter TargetName="LineRightButton" Property="Visibility" Value="Visible" />
        				</MultiTrigger>
        			</ControlTemplate.Triggers>
        		</ControlTemplate>


        	</Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value >
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--listBoxWithAutoScroll_Vertical-->
    <Style x:Key="ListBoxWithAutoScroll_Vertical" TargetType="{x:Type ListBox}" >
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="ItemTemplate" Value="{DynamicResource MyEquityTemplate}"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource CustomListBoxItem}"/>
        <Setter Property="Template">
            <Setter.Value >
                <ControlTemplate>
                    <Grid >
                        <ScrollViewer x:Name="scrollviewer" BorderThickness="1" BorderBrush="#FF7FE5E3" >
                            <ScrollViewer.Template>
                                <ControlTemplate TargetType="{x:Type ScrollViewer}" >
                                    <Grid>
                                        <ScrollBar x:Name="PART_VerticalScrollBar" Orientation="Vertical" 
                                                               Value="{TemplateBinding VerticalOffset}"
                                                               Maximum="{TemplateBinding ScrollableHeight}"
                                                               ViewportSize="{TemplateBinding ViewportHeight}"
                                                               Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                                               Width="{Binding Width, ElementName=Panel}">
                                            <ScrollBar.Template>
                                                <ControlTemplate>
                                                    <Track x:Name="PART_Track" IsDirectionReversed="True">
                                                        <Track.DecreaseRepeatButton>
                                                            <RepeatButton Command="ScrollBar.PageUpCommand"
						                                                    Style="{StaticResource ScrollBarPageButton}"/>
                                                        </Track.DecreaseRepeatButton>
                                                        <Track.IncreaseRepeatButton>
                                                            <RepeatButton Command="ScrollBar.PageDownCommand"
						                                                    Style="{StaticResource ScrollBarPageButton}"/>
                                                        </Track.IncreaseRepeatButton>
                                                        <Track.Thumb>
                                                            <Thumb Style="{StaticResource ScrollBarThumbVertical}" 
                                                                         Background="Gray" Opacity="0.8" Margin="-1,0" />
                                                        </Track.Thumb>
                                                    </Track>
                                                </ControlTemplate>
                                            </ScrollBar.Template>
                                        </ScrollBar>
                                        <ScrollContentPresenter Margin="2,0" Width="Auto" HorizontalAlignment="Center"/>
                                    </Grid>
                                </ControlTemplate>
                            </ScrollViewer.Template>
                            <ItemsPresenter/>
                        </ScrollViewer>
                        <Grid x:Name="Panel" Margin="2,0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <RepeatButton x:Name="LineUpButton" Grid.Row="0" Height="20" Opacity="0" Visibility="Collapsed"
                                      Style="{StaticResource ScrollBarLineButton}"
                                      Content="M 0 8 L 32 8 L 16 0 Z"      
                                      Command="{x:Static ScrollBar.LineUpCommand}"       
                                      CommandTarget="{Binding ElementName=scrollviewer}"
                                      ClickMode="Hover" />
                            <RepeatButton x:Name="LineDownButton" Grid.Row="2" Height="20" Opacity="0" Visibility="Collapsed"
                                      Style="{StaticResource ScrollBarLineButton}"
                                      Content="M 0 0 L 16 8 L 32 0 Z" 
                                      Command="{x:Static ScrollBar.LineDownCommand}"       
                                      CommandTarget="{Binding ElementName=scrollviewer}"
                                      ClickMode="Hover"/>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True"/>
                                <Condition Property="ComputedVerticalScrollBarVisibility" SourceName="scrollviewer" Value="Visible"/>
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="LineUpButton" 
                                                             Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
                                        <DoubleAnimation Storyboard.TargetName="LineDownButton" 
                                                             Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="LineUpButton" 
                                                             Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
                                        <DoubleAnimation Storyboard.TargetName="LineDownButton" 
                                                             Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.ExitActions>
                        	<Setter TargetName="LineUpButton" Property="Visibility" Value="Visible" />
                        	<Setter TargetName="LineDownButton" Property="Visibility" Value="Visible" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value >
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="StorageListBox" TargetType="{x:Type ListBox}" >
    	<Setter Property="SnapsToDevicePixels" Value="true"/>
    	<Setter Property="OverridesDefaultStyle" Value="true"/>
    	<Setter Property="ItemTemplate" Value="{DynamicResource MyEquityTemplate}"/>
    	<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    	<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    	<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
    	<Setter Property="Background" Value="Transparent"/>
    	<Setter Property="ItemContainerStyle" Value="{StaticResource CustomListBoxItem}"/>
    	<Setter Property="Template">
    		<Setter.Value >
    			<ControlTemplate>
    				<Grid >
    					<ScrollViewer x:Name="scrollviewer" BorderThickness="1" BorderBrush="#FF7FE5E3" >
    						<ScrollViewer.Template>
    							<ControlTemplate TargetType="{x:Type ScrollViewer}" >
    								<Grid>
    									<ScrollBar x:Name="PART_VerticalScrollBar" Orientation="Vertical" 
    										Value="{TemplateBinding VerticalOffset}"
    										Maximum="{TemplateBinding ScrollableHeight}"
    										ViewportSize="{TemplateBinding ViewportHeight}"
    										Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
    										Width="{Binding Width, ElementName=Panel}">
    										<ScrollBar.Template>
    											<ControlTemplate>
    												<Track x:Name="PART_Track" IsDirectionReversed="True">
    													<Track.DecreaseRepeatButton>
    														<RepeatButton Command="ScrollBar.PageUpCommand"
    															Style="{StaticResource ScrollBarPageButton}"/>
    													</Track.DecreaseRepeatButton>
    													<Track.IncreaseRepeatButton>
    														<RepeatButton Command="ScrollBar.PageDownCommand"
    															Style="{StaticResource ScrollBarPageButton}"/>
    													</Track.IncreaseRepeatButton>
    													<Track.Thumb>
    														<Thumb Style="{StaticResource ScrollBarThumbVertical}" 
    															Background="Gray" Opacity="0.8" Margin="-1,0" />
    													</Track.Thumb>
    												</Track>
    											</ControlTemplate>
    										</ScrollBar.Template>
    									</ScrollBar>
    									<ScrollContentPresenter Margin="2,0" Width="Auto" HorizontalAlignment="Center"/>
    								</Grid>
    							</ControlTemplate>
    						</ScrollViewer.Template>
    						<ItemsPresenter/>
    					</ScrollViewer>
    					<Grid x:Name="Panel" Margin="2,0">
    						<Grid.RowDefinitions>
    							<RowDefinition Height="Auto"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="Auto"/>
    						</Grid.RowDefinitions>
    						<RepeatButton x:Name="LineUpButton" Grid.Row="0" Height="20" Opacity="0" Visibility="Collapsed"
    							Style="{StaticResource ScrollBarLineButton}"
    							Content="M 0 8 L 32 8 L 16 0 Z"      
    							Command="{x:Static ScrollBar.LineUpCommand}"       
    							CommandTarget="{Binding ElementName=scrollviewer}"
    							ClickMode="Hover" />
    						<RepeatButton x:Name="LineDownButton" Grid.Row="2" Height="20" Opacity="0" Visibility="Collapsed"
    							Style="{StaticResource ScrollBarLineButton}"
    							Content="M 0 0 L 16 8 L 32 0 Z" 
    							Command="{x:Static ScrollBar.LineDownCommand}"       
    							CommandTarget="{Binding ElementName=scrollviewer}"
    							ClickMode="Hover"/>
    					</Grid>
    				</Grid>
    				<ControlTemplate.Triggers>
    					<MultiTrigger>
    						<MultiTrigger.Conditions>
    							<Condition Property="IsMouseOver" Value="True"/>
    							<Condition Property="ComputedVerticalScrollBarVisibility" SourceName="scrollviewer" Value="Visible"/>
    						</MultiTrigger.Conditions>
    						<MultiTrigger.EnterActions>
    							<BeginStoryboard>
    								<Storyboard>
    									<DoubleAnimation Storyboard.TargetName="LineUpButton" 
    										Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
    									<DoubleAnimation Storyboard.TargetName="LineDownButton" 
    										Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
    								</Storyboard>
    							</BeginStoryboard>
    						</MultiTrigger.EnterActions>
    						<MultiTrigger.ExitActions>
    							<BeginStoryboard>
    								<Storyboard>
    									<DoubleAnimation Storyboard.TargetName="LineUpButton" 
    										Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
    									<DoubleAnimation Storyboard.TargetName="LineDownButton" 
    										Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
    								</Storyboard>
    							</BeginStoryboard>
    						</MultiTrigger.ExitActions>
    						<Setter TargetName="LineUpButton" Property="Visibility" Value="Visible" />
    						<Setter TargetName="LineDownButton" Property="Visibility" Value="Visible" />
    					</MultiTrigger>
    				</ControlTemplate.Triggers>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    	<Setter Property="ItemsPanel">
    		<Setter.Value >
    			<ItemsPanelTemplate>
    				<VirtualizingStackPanel Orientation="Vertical"/>
    			</ItemsPanelTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>


	<DataTemplate x:Key="MyEquityTemplate">
		<DataTemplate.Resources>
			<Storyboard x:Key="OnMouseEnter1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="GelBackground">
					<EasingDoubleKeyFrame KeyTime="0" Value="0.7"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
			<Storyboard x:Key="OnMouseLeave1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="GelBackground">
					<EasingDoubleKeyFrame KeyTime="0" Value="0.3"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</DataTemplate.Resources>
		<Grid x:Name="grid" Margin="0" Height="40" d:DesignWidth="400" Width="300" RenderTransformOrigin="0.5,0.5">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<Grid.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Grid.RenderTransform>
			<Rectangle x:Name="GelBackground" Opacity="1" RadiusX="8" RadiusY="8" StrokeThickness="0.5" Stroke="{x:Null}" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1" Grid.Column="0" Margin="5,2" Width="290" Height="36">
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.3">
						<GradientStop Color="#FFEFECEC"/>
						<GradientStop Offset="0.361"/>
						<GradientStop Color="#FFEFECEC" Offset="1"/>
						<GradientStop Offset="0.699"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>
			<Image Width="30" Margin="20,5,0,5" Height="30" Source="Images/busy-icon.png" Visibility="{Binding Stop, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left"/>
			<Image Width="40" Margin="20,5,0,5" Height="Auto" Source="{Binding ImagePath, Mode=OneWay}" Visibility="{Binding IconVisible, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left"/>
			<TextBlock FontFamily="Segoe UI"    x:Name="NameBlock"  Width="Auto"  Text="{Binding Vm.Name, Mode=OneWay}" Margin="92,7,0,7" FontSize="14.667" FontWeight="Normal" VerticalAlignment="Stretch" Height="26" TextAlignment="Center" HorizontalAlignment="Left" Foreground="#FFFDF9F9"/>
		</Grid>
		<DataTemplate.Triggers>
			<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="grid">
				<BeginStoryboard x:Name="OnMouseLeave1_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
			</EventTrigger>
			<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="grid">
				<BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
			</EventTrigger>
		</DataTemplate.Triggers>
	</DataTemplate>
	<DataTemplate x:Key="MyEquityTemplate3">
		<DataTemplate.Resources>
			<Storyboard x:Key="OnMouseEnter1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="GelBackground">
					<EasingDoubleKeyFrame KeyTime="0" Value="0.7"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
			<Storyboard x:Key="OnMouseLeave1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="GelBackground">
					<EasingDoubleKeyFrame KeyTime="0" Value="0.3"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</DataTemplate.Resources>
		<Grid x:Name="grid" Margin="0" Height="Auto" d:DesignWidth="400" Width="Auto" RenderTransformOrigin="0.5,0.5">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<Grid.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Grid.RenderTransform>
			<Rectangle x:Name="GelBackground" Opacity="1" RadiusX="8" RadiusY="8" StrokeThickness="0.5" Stroke="{x:Null}" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1" Grid.Column="0" Margin="5,2" Width="Auto" Height="Auto">
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.3">
						<GradientStop Color="#FFEFECEC"/>
						<GradientStop Offset="0.361"/>
						<GradientStop Color="#FFEFECEC" Offset="1"/>
						<GradientStop Offset="0.699"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>
			<TextBlock FontFamily="Segoe UI"    x:Name="NameBlock" Grid.Column="0"  Width="Auto"  Text="{Binding Name, Mode=OneWay}" Margin="10,7" FontSize="16" FontWeight="Bold" VerticalAlignment="Stretch" Height="Auto" TextAlignment="Center" Grid.Row="0"/>
		</Grid>
		<DataTemplate.Triggers>
			<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="grid">
				<BeginStoryboard x:Name="OnMouseLeave1_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
			</EventTrigger>
			<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="grid">
				<BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
			</EventTrigger>
		</DataTemplate.Triggers>
	</DataTemplate>
	<DataTemplate x:Key="MyEquityTemplate2">
		<DataTemplate.Resources>
			<Storyboard x:Key="OnMouseEnter1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="GelBackground">
					<EasingDoubleKeyFrame KeyTime="0" Value="0.7"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
			<Storyboard x:Key="OnMouseLeave1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="GelBackground">
					<EasingDoubleKeyFrame KeyTime="0" Value="0.3"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</DataTemplate.Resources>
		<Grid x:Name="grid" Margin="0" Height="Auto" d:DesignWidth="256" RenderTransformOrigin="0.5,0.5" Width="172">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<Grid.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Grid.RenderTransform>
			<Rectangle x:Name="GelBackground" Opacity="1" RadiusX="8" RadiusY="8" StrokeThickness="0.5" Stroke="{x:Null}" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1" Grid.Column="0" Margin="5,2" Width="Auto" Height="Auto">
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.3">
						<GradientStop Color="#FFEFECEC"/>
						<GradientStop Offset="0.361"/>
						<GradientStop Color="#FFEFECEC" Offset="1"/>
						<GradientStop Offset="0.699"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>
			<TextBlock FontFamily="Segoe UI"    x:Name="NameBlock" Grid.Column="0"  Width="Auto"  Text="{Binding Name, Mode=OneWay}" Margin="10,7" FontSize="16" FontWeight="Bold" VerticalAlignment="Stretch" Height="Auto" TextAlignment="Center" Grid.Row="0"/>
		</Grid>
		<DataTemplate.Triggers>
			<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="grid">
				<BeginStoryboard x:Name="OnMouseLeave1_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
			</EventTrigger>
			<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="grid">
				<BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
			</EventTrigger>
		</DataTemplate.Triggers>
	</DataTemplate>
	
	
	<Style x:Key="ListBoxWithAutoScroll_Horizontal2" TargetType="{x:Type ListBox}" >
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="ItemTemplate" Value="{DynamicResource ScreenShotTemplate}"/>
		<Setter Property="ItemContainerStyle" Value="{StaticResource CustomListBoxItem}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ListBox}">
					<Grid >
						<ScrollViewer x:Name="scrollviewer" >
							<ScrollViewer.Template>
								<ControlTemplate TargetType="{x:Type ScrollViewer}" >
									<Grid>
										<ScrollBar x:Name="PART_HorizontalScrollBar" Orientation="Horizontal" 
											Value="{TemplateBinding HorizontalOffset}"
											Maximum="{TemplateBinding ScrollableWidth}"
											ViewportSize="{TemplateBinding ViewportWidth}"
											Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
											Height="{Binding Height, ElementName=Panel}">
											<ScrollBar.Template>
												<ControlTemplate>
													<Track x:Name="PART_Track">
														<Track.DecreaseRepeatButton>
															<RepeatButton Command="ScrollBar.PageLeftCommand"
																Style="{StaticResource ScrollBarPageButton}"/>
														</Track.DecreaseRepeatButton>
														<Track.IncreaseRepeatButton>
															<RepeatButton Command="ScrollBar.PageRightCommand"
																Style="{StaticResource ScrollBarPageButton}"/>
														</Track.IncreaseRepeatButton>
														<Track.Thumb>
															<Thumb Style="{StaticResource ScrollBarThumb}" 
																Background="Gray" Opacity="0.8" Margin="0,-1" />
														</Track.Thumb>
													</Track>
												</ControlTemplate>
											</ScrollBar.Template>
										</ScrollBar>
										<ScrollContentPresenter Margin="0,2" Height="Auto" VerticalAlignment="Center"/>
									</Grid>
								</ControlTemplate>
							</ScrollViewer.Template>
							<ItemsPresenter/>
						</ScrollViewer>
						<Grid x:Name="Panel" Margin="0,2" >
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>
							<RepeatButton x:Name="LineLeftButton" Grid.Column="0" Width="20" Opacity="0" Visibility="Collapsed"
								Style="{StaticResource ScrollBarLineButton}"
								Content="M 8 0 L 8 32 L 0 16 Z"       
								Command="{x:Static ScrollBar.LineLeftCommand}"       
								CommandTarget="{Binding ElementName=scrollviewer}"
								ClickMode="Hover" />
							<RepeatButton x:Name="LineRightButton" Grid.Column="2" Width="20" Opacity="0" Visibility="Collapsed"
								Style="{StaticResource ScrollBarLineButton}"
								Content="M 0 0 L 8 16 L 0 32 Z" 
								Command="{x:Static ScrollBar.LineRightCommand}"       
								CommandTarget="{Binding ElementName=scrollviewer}"
								ClickMode="Hover"/>
						</Grid>
					</Grid>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
								<Condition Property="ComputedHorizontalScrollBarVisibility" SourceName="scrollviewer" Value="Visible"/>
							</MultiTrigger.Conditions>
							<MultiTrigger.EnterActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="LineLeftButton" 
											Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
										<DoubleAnimation Storyboard.TargetName="LineRightButton" 
											Storyboard.TargetProperty="Opacity" To="0.8" Duration="0:0:0.25"/>
									</Storyboard>
								</BeginStoryboard>
							</MultiTrigger.EnterActions>
							<MultiTrigger.ExitActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="LineLeftButton" 
											Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
										<DoubleAnimation Storyboard.TargetName="LineRightButton" 
											Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25"/>
									</Storyboard>
								</BeginStoryboard>
							</MultiTrigger.ExitActions>
							<Setter TargetName="LineLeftButton" Property="Visibility" Value="Visible" />
							<Setter TargetName="LineRightButton" Property="Visibility" Value="Visible" />
						</MultiTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>


			</Setter.Value>
		</Setter>
		<Setter Property="ItemsPanel">
			<Setter.Value >
				<ItemsPanelTemplate>
					<VirtualizingStackPanel Orientation="Horizontal"/>
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<DataTemplate x:Key="ScreenShotTemplate">
		<DataTemplate.Resources>
			<Storyboard x:Key="OnMouseEnter1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="grid">
					<EasingDoubleKeyFrame KeyTime="0" Value="160">
						<EasingDoubleKeyFrame.EasingFunction>
							<ElasticEase EasingMode="EaseIn" Oscillations="2"/>
						</EasingDoubleKeyFrame.EasingFunction>
					</EasingDoubleKeyFrame>
					<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="320">
						<EasingDoubleKeyFrame.EasingFunction>
							<BackEase EasingMode="EaseOut"/>
						</EasingDoubleKeyFrame.EasingFunction>
					</EasingDoubleKeyFrame>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="grid">
					<EasingDoubleKeyFrame KeyTime="0" Value="240"/>
					<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="480"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
			<Storyboard x:Key="OnMouseLeave1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="grid">
					<SplineDoubleKeyFrame KeyTime="0" Value="320"/>
					<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="160">
						<EasingDoubleKeyFrame.EasingFunction>
							<ElasticEase EasingMode="EaseIn" Oscillations="2"/>
						</EasingDoubleKeyFrame.EasingFunction>
					</EasingDoubleKeyFrame>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="grid">
					<EasingDoubleKeyFrame KeyTime="0" Value="480"/>
					<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="240"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</DataTemplate.Resources>
		<Grid x:Name="grid" Margin="0" Height="160" d:DesignWidth="400" Width="240" RenderTransformOrigin="0.5,0.5">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.03*"/>
				<ColumnDefinition Width="0.94*"/>
				<ColumnDefinition Width="0.03*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="0,1*"/>
				<RowDefinition Height="0,8*"/>
				<RowDefinition Height="0,1*"/>
			</Grid.RowDefinitions>
			<Grid.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Grid.RenderTransform>
			<Image x:Name="image" Margin="0" Source="{Binding Image}" RenderTransformOrigin="0.5,0.5" Grid.Column="0" Stretch="Uniform" Grid.Row="0" Grid.RowSpan="3" Grid.ColumnSpan="3">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
		</Grid>
	</DataTemplate>
	<DataTemplate x:Key="ScreenShotTemplate2">
		<DataTemplate.Resources>
			<Storyboard x:Key="OnMouseEnter1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="grid">
					<EasingDoubleKeyFrame KeyTime="0" Value="240">
						<EasingDoubleKeyFrame.EasingFunction>
							<ElasticEase EasingMode="EaseIn" Oscillations="2"/>
						</EasingDoubleKeyFrame.EasingFunction>
					</EasingDoubleKeyFrame>
					<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="320">
						<EasingDoubleKeyFrame.EasingFunction>
							<BackEase EasingMode="EaseOut"/>
						</EasingDoubleKeyFrame.EasingFunction>
					</EasingDoubleKeyFrame>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="grid">
					<EasingDoubleKeyFrame KeyTime="0" Value="160">
						<EasingDoubleKeyFrame.EasingFunction>
							<ElasticEase EasingMode="EaseIn" Oscillations="2"/>
						</EasingDoubleKeyFrame.EasingFunction>
					</EasingDoubleKeyFrame>
					<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="240">
						<EasingDoubleKeyFrame.EasingFunction>
							<BackEase EasingMode="EaseOut"/>
						</EasingDoubleKeyFrame.EasingFunction>
					</EasingDoubleKeyFrame>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
			<Storyboard x:Key="OnMouseLeave1">
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="grid">
					<EasingDoubleKeyFrame KeyTime="0" Value="320"/>
					<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="240"/>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="grid">
					<EasingDoubleKeyFrame KeyTime="0" Value="240"/>
					<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="160"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</DataTemplate.Resources>
		<Grid x:Name="grid" Margin="0" Height="120" d:DesignWidth="400" Width="184" RenderTransformOrigin="0.5,0.5">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.033*"/>
				<ColumnDefinition Width="0.925*"/>
				<ColumnDefinition Width="0.042*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="0,9*"/>
				<RowDefinition Height="0,1*"/>
			</Grid.RowDefinitions>
			<Grid.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Grid.RenderTransform>
			<Image x:Name="image" Margin="0,16,0,8" Source="{Binding FileName}" RenderTransformOrigin="0.5,0.5" Grid.Column="1" Stretch="Uniform">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
		</Grid>
	</DataTemplate>


</ResourceDictionary>
